#autoload

[[ $_comp_tags == *\ (history-lines|recent-)* ]] &&
    return 1

# Is not going to be correct.
[[ -v _autocomplete__partial_list ]] &&
    return 1

# No need to update.
[[ $compstate[old_list] == keep ]] &&
    return 1

# Doesn't make sense to show.
(( compstate[nmatches] < 2 )) &&
    return 1

# Nothing to insert.
[[ -z $compstate[unambiguous] ]] &&
    return 1

# Substring is already present.
local -P word=$IPREFIX$PREFIX$SUFFIX$ISUFFIX
[[ -n $word && $word == *$compstate[unambiguous]* ]] &&
    return 1

local -P tag=unambiguous
_tags $tag
_tags ||
    return
_requested $tag ||
    return

typeset -g _autocomplete__unambiguous="$compstate[unambiguous]"

builtin compadd -J "$tag" -x $'%{\e[0;2m%}%Bcommon substring:%b %F{0}%K{11}'"$compstate[unambiguous]%f%k"

false
